/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.warehous.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.asset.dto.warehous.WarehousCreateDTO;
import com.fuyao.cloud.asset.dto.warehous.WarehousEditDTO;
import com.fuyao.cloud.asset.dto.warehous.WarehousSearchDTO;
import com.fuyao.cloud.asset.entity.AssetCard;
import com.fuyao.cloud.asset.entity.ac.AssetAc;
import com.fuyao.cloud.asset.entity.warehous.Warehous;
import com.fuyao.cloud.asset.vo.warehous.WarehousPageVO;
import com.fuyao.cloud.common.core.util.R;

import java.util.List;

/**
 * 入库管理
 *
 * @author liyue
 * @date 2021-12-06 20:19:22
 */
public interface WarehousService extends IService<Warehous> {

	/**
	 * 查询入库单
	 *
	 * @param query 查询构造器
	 * @param classify 类型
	 * @return 入库单集合
	 */
	List listWarehous(QueryWrapper<Warehous> query,String classify);

	/**
	 * 入库单创建对象
	 * @param classify 单据类型
	 * @return 入库单
	 */
	WarehousCreateDTO create(String classify);


	/**
	 * 入库单编辑方法
	 * @param id  id
	 * @return 入库单编辑对象。
	 */
	WarehousEditDTO edit(Long id);

	/**
	 * 重写入库相关分页方法
	 * @param page 分页对象
	 * @param queryWrapper 条件构造器
	 * @param searchDTO 查询对象
	 * @return 分页对象
	 */
	IPage<Warehous> page(Page page, QueryWrapper queryWrapper, WarehousSearchDTO searchDTO);

	/**
	 * 批量删除
	 * @param ids 业务ids集合
	 * @return R
	 */
	R batchDelete(List<Long> ids);

	/**
	 * 生成入库单
	 * @param assetAc 验收对象
	 * @return 是否生成成功
	 */
	boolean generateByWarehouse(AssetAc assetAc,List<AssetCard> assetCardList);

	/**
	 * 入库单分页查询
	 * @param page
	 * @param spliceSearchCondition
	 * @param searchDTO
	 * @return
	 */
    IPage<WarehousPageVO> getWarehousPage(Page page, QueryWrapper spliceSearchCondition, WarehousSearchDTO searchDTO);

	/**
	 * 冲销 资产信息
	 * @param warehous 冲销对象
	 */
	void classifyAssetCard(Warehous warehous);
}
